(in-package :context-indexing)

(defun mean (x)
  (declare #.*standard-optimize-settings*)
  (/ (sum x) (length x)))
  
(defun central-moment (k x)
  (declare #.*standard-optimize-settings*)
  (sum (op expt (- _ (mean x)) k) x))
  
(defun kurtosis (x)
  (declare #.*standard-optimize-settings*)
  (* (length x) (central-moment 4 x) (expt (central-moment 2 x) -2)))

(defun uniform-distribution ()
  (1- (random 2.0)))
